﻿using System;
using System.Collections.Generic;
using System.Text;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;

namespace mozhi.smarterp.Business.Sales
{
    public class SaleOrderDelivery : AuditedAggregateRoot<Guid>, IMultiTenant
    {
        public Guid? TenantId { get; private set; }

        public Guid DeliveryId { get; private set; }

        public Guid DeliveryItemId { get; private set; }

        public Guid OrderId { get; private set; }

        public Guid OrderItemId { get; private set; }

        private SaleOrderDelivery() { }

        public SaleOrderDelivery(Guid id,  Guid orderId, Guid orderItemId , Guid deliveryId, Guid deliveryItemId)
        {
            Id = id;
            DeliveryId = deliveryId;
            DeliveryItemId = deliveryItemId;
            OrderId = orderId;
            OrderItemId = orderItemId;

            Validate();
        }

        #region
        private void Validate()
        {
            Check.NotDefaultOrNull<Guid>(DeliveryId, nameof(DeliveryId));
            Check.NotDefaultOrNull<Guid>(DeliveryItemId, nameof(DeliveryItemId));
            Check.NotDefaultOrNull<Guid>(OrderId, nameof(OrderId));
            Check.NotDefaultOrNull<Guid>(OrderItemId, nameof(OrderItemId));
        }
        #endregion
    }
}
